#include "UmlApplication.h"
#include "mainwindow.h"

#include <DWidgetUtil>

#include <QDesktopWidget>

#define registerMetaType(t) {qRegisterMetaType<t>(#t);}

int main(int argc, char *argv[])
{
    UmlApplication app(argc, argv);

    // 只允许单一实例启动
    if (!app.setSingleInstance(app.applicationName(), DApplication::SystemScope)) {
        qCritical() << "set single instance failed";
        return -1;
    }

    MainWindow w;
    w.resize(QDesktopWidget().availableGeometry().size() * 0.8);
    w.show();

    Dtk::Widget::moveToCenter(&w);

    return app.exec();
}
